<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script>
        function getQueryString(str) {
            var url = String(window.document.URL);

            var rs = new RegExp("(^|)" + str + "=([^&]*)(&|$)", "gi").exec(url);
            if (rs === null){
                window.location.href="/webstudy/static/login.html";
            }
            return rs[2];
        }

        function jump(action) {

            console.log(action);

            if("1" == action){ // 计算每分钟滴数
                alert("计算每分钟滴数");
                window.location.href="per_min.html";
            } else if ("2" == action){ // 计算输液所用时间
                alert("计算输液所用时间");
                window.location.href="sum_time.html";
            }
        }
    </script>
    <style>
        /**
        将p标签转为行内元素
         */
        p {
            display: inline;
        }
    </style>
</head>
<body>
    <button  onclick="jump(1)">计算每分钟滴数</button>
    <br/>
    <button  onclick="jump(2)">计算输液所用时间</button>

</body>
</html>